// 签名
import _bale from '../utils/package.js'
// 获取不同的接口地址
import { COMMON_API, SHARE_API, ACTIVITY_API, OEDER_API ,PAY_API} from '../config/index.js'
import { Service } from '../utils/server.js'
class PayModel extends Service {
  // 订单结算
  getPayOrder(params) {
    return this.postRequest(OEDER_API + '/order/confirmOrder', {
      data: _bale('confirmOrder', params)
    })
  }
  // 提交订单
  submitOrder(params) {
    return this.postRequest(OEDER_API + '/order/submitOrder', {
      data: _bale('submitOrder', params)
    })
  }
  // 订单支付
  pay(params) {
    return this.postRequest(PAY_API + '/orderPay/payment', {
      data: _bale('payment', params)
    })
  }

  // 订单支付结果查询
  payResult(params) {
    return this.postRequest(PAY_API + '/orderPay/paymentResult', {
      data: _bale('paymentResult', params)
    })
  }

  //查询金币管理信息
  queryGold(params) {
    return this.postRequest(COMMON_API + '/ruleCommon/queryGold', {
      data: _bale('queryGold', params)
    })
  }

  // 会员支付
  paymentVip(params) {
    return this.postRequest(PAY_API + '/orderPay/paymentVip', {
      data: _bale('paymentVip', params)
    })
  }

  // 会员支付结果查询
  paymentVipResult(params) {
    return this.postRequest(PAY_API + '/orderPay/paymentVipResult', {
      data: _bale('paymentVipResult', params)
    })
  }
}
export { PayModel }
